package ullio.video
{
	import mx.containers.HBox;
	import mx.controls.Spacer;

	public class VideoControlBar extends HBox
	{			
		public var ppButton:PlayPauseButton;
		public var scrubberCanvas:ScrubberCanvas;
		public var scrubberSlider:ScrubberSlider;
		public var scrubberProgress:ScrubberProgress;
		public var timerLabel:TimerLabel;
		public var volumeSlider:VolumeSlider;
		public var fsButton:FullScreenButton;
		
		private var spacer:Spacer;
		
		public function VideoControlBar()
		{
			super();			
			horizontalScrollPolicy = 'off';
			verticalScrollPolicy = 'off';					
		}
		
		override protected function createChildren():void
		{
			super.createChildren();
			
			ppButton = new PlayPauseButton();
			addChild(ppButton);
			
			scrubberSlider = new ScrubberSlider();	
			addChild(scrubberSlider);		
			
			timerLabel = new TimerLabel();
			addChild(timerLabel);
			
			volumeSlider = new VolumeSlider();
			addChild(volumeSlider);
			
			spacer = new Spacer();
			spacer.percentWidth = 100;
			addChild(spacer);
			
			fsButton = new FullScreenButton();
			addChild(fsButton);			
		}
		override protected function commitProperties():void
		{
			super.commitProperties();
			
			timerLabel.selectable = false;							
		}
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
    	{
			super.updateDisplayList(unscaledWidth, unscaledHeight);
			ppButton.height = height;
			ppButton.width = height + 10;
			scrubberSlider.height = height;
			fsButton.height = height;
			fsButton.width = height + 10;
    	} 
		
	}
}